<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdministratorsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('administrators', function (Blueprint $table) {
            $table->increments('id');

            // 后台用户账户
            $table->string('user')->unique();

            $table->string('password', 60);

            $table->string('email', 60)->unique();

            $table->dateTime('last_login')->default('0000-00-00 00:00:00');

            // 登录次数
            $table->integer('login_count')->default(0);

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('administrators');
    }
}
